# Maintainer: Orhun Parmaksız <orhun@archlinux.org>

pkgname=igrep
pkgver=1.1.0
pkgrel=2
pkgdesc="Interactive grep"
arch=('loong64' 'x86_64')
url="https://github.com/konradsz/igrep"
license=('MIT')
depends=('gcc-libs')
makedepends=('cargo')
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha512sums=('29d5bc48736449ec01b4616e8d21b6df85b1c011f5a576476f1bc0d97fd6e09be635549a40e8f7a2246af7f2bc442bf0bfd4a32c0a59aa39ee557bbcc791c62e')
options=('!lto')

prepare() {
  cd "$pkgname-$pkgver"
  cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

build() {
  cd "$pkgname-$pkgver"
  cargo build --release --frozen
}

check() {
  cd "$pkgname-$pkgver"
  cargo test --frozen
}

package() {
  cd "$pkgname-$pkgver"
  install -Dm 755 "target/release/ig" -t "$pkgdir/usr/bin"
  install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
  install -Dm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
}

# vim: ts=2 sw=2 et:
